1

00:00:00,389  -->  00:00:07,071
In the previous video, we already write a
script to do network automation using netmiko.

2

00:00:07,730  -->  00:00:11,710
The script is to send show command to the router.

3

00:00:12,582  -->  00:00:18,972
Now In this video, we are going to learn
how to configure the router using netmiko

4

00:00:19,839  -->  00:00:27,649
Let’s see the documentation first, here to
send show command, we can use send_command,

5

00:00:28,441  -->  00:00:35,155
but if we want to send configuration
command, we need to use send_config_set.

6

00:00:36,000  -->  00:00:39,108
What is the differences between this two method?

7

00:00:40,757  -->  00:00:48,266
If we use send_config_set, netmiko will
automatically send configure terminal

8

00:00:48,521  -->  00:00:50,119
and end command.

9

00:00:50,917  -->  00:00:56,633
Here we can see the output, in the
first, we have config term command,

10

00:00:57,307  -->  00:01:01,165
and then in the end, we have end command.

11

00:01:01,816  -->  00:01:06,134
This two command is sent automatically by netmiko.

12

00:01:07,317  -->  00:01:15,364
And then here for the send_config_set method,
the argument is a list, so we can write the

13

00:01:15,364  -->  00:01:23,871
cisco command to do configuration on the list, and
then send it to the router using send_config_set.

14

00:01:24,606  -->  00:01:28,100
Let’s just try it, go to sublime.

15

00:01:28,728  -->  00:01:33,376
Now let’s write a command to create
loopback interface on the router.

16

00:01:34,545  -->  00:01:39,000
List_config, and then let’s
write the cisco command,

17

00:01:41,440  -->  00:01:43,298
Interface loopback0,

18

00:01:47,425  -->  00:01:54,305
Ip address 10.1.1.1 255.255.255.255

19

00:01:55,680  -->  00:02:10,774
Let’s also create loopback1, so here interface
loopback1, ip address 10.1.1.2 255.255.255.255

20

00:02:12,000  -->  00:02:19,509
Now let’s execute this command, output,
conn, this is the connection variable

21

00:02:19,509  -->  00:02:28,046
that we already defined before, and
then send_config_set list_config.

22

00:02:32,408  -->  00:02:34,672
Now let’s print the output.

23

00:02:38,484  -->  00:02:41,630
Save, let’s run the script

24

00:02:48,000  -->  00:02:56,045
Okay here we can see that we configure loopback0
and loopback1, and then print the interface.

25

00:02:56,856  -->  00:03:02,317
And here we can see that now we
have loopback0 and loopback1.

26

00:03:03,345  -->  00:03:10,441
If we see here, we have configure
terminal and end command, once again,

27

00:03:10,640  -->  00:03:15,039
this command is sent to the
router automatically by netmiko.

28

00:03:16,216  -->  00:03:21,085
Okay I think enough for this video,
I hope you understand the differences

29

00:03:21,085  -->  00:03:24,623
between send_command and send_config_set.

30

00:03:25,440  -->  00:03:28,877
Thank you for watching and
see you on the next video.
